from pyecharts import options as opts
from pyecharts.charts import Map

guangdong_city = ['天心区', '岳麓区', '开福区', '望城区', '芙蓉区', '长沙县', '雨花区']
values = [29, 99, 34, 4, 27, 10, 35]

map = Map()
map.add("商家A", [list(z) for z in zip(guangdong_city, values)], "长沙")
map.set_global_opts(title_opts=opts.TitleOpts(title="长沙地图"),
visualmap_opts=opts.VisualMapOpts())
map.render(path = '长沙地图.html')

# import pandas as pd
# import numpy as np
#
# print("-----------------")
# # print(a,type(a),'\n',a.columns)
# # print()
# # print(b,type(b),'\n',b.columns)
# # print()
# # print(c,type(c))
# df = pd.DataFrame({'data1':np.random.rand(2),
#                   'data2':np.random.rand(2),
#                   'key1':['a','b'],
#                   'key2':['one','two']})
# print(df)
# print(df.dtypes)
# print("-------------")
# print(df.groupby(df.dtypes, axis=1))
# print('-----')
# print(list(df.groupby(df.dtypes, axis=1)))
# print()
# for n,p in df.groupby(df.dtypes, axis=1):
#     print(n)
#     print()
#     print(p)
#     print('##')